package org.atguigu.gmall.realtime.join;

import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.table.api.bridge.java.StreamTableEnvironment;
import org.atguigu.gmall.realtime.app.BaseSQLApp;
import org.atguigu.gmall.realtime.util.SQLUtil;

/**
 * @Author zenghaifeng
 * @Date 2023/4/24 23:57
 * @Package: org.atguigu.gmall.realtime.join
 * @Class: ComsumeLeftJoinWithSQLKafka
 * @Description: TODO
 * @Version 1.0
 */
public class ConsumeLeftJoinWithSQLKafka extends BaseSQLApp {

    public static void main(String[] args) {
        new ConsumeLeftJoinWithSQLKafka().init(50003,2,"ConsumeLeftJoinWithSQLKafka");
    }
    @Override
    protected void handle(StreamExecutionEnvironment env, StreamTableEnvironment tbe) {
        tbe.executeSql("create table ab(" +
                "  id string, " +
                "  name string, " +
                "  age int " +
                ")" + SQLUtil.getKafkaSourceDDL("ab_left", "json"));

        tbe.sqlQuery("select * from ab").execute().print();

    }
}
